import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import http from '@/request/index.js'

import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import '@/styles/base.css'
import '@/styles/index.css'

import * as echarts from 'echarts'

import * as ElementPlusIconsVue from '@element-plus/icons-vue'

const app = createApp(App)

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

app.config.globalProperties.$http = http
// 把 echarts 挂载到 Vue 全局
app.config.globalProperties.$echarts = echarts
app
  .use(ElementPlus)
  .use(store)
  .use(router)
  .mount('#app')
